package com.sskj.b70.v.activity;

import android.content.Context;
import android.content.Intent;
import android.widget.CheckBox;
import android.widget.TextView;

import com.sskj.b70.MyAppLication;
import com.sskj.b70.R;
import com.sskj.b70.common.App;
import com.sskj.b70.common.widget.ToolBarLayout;
import com.sskj.b70.p.activity.SmsSwitchPresenter;
import com.sskj.b70.v.base.BaseActivity;

import butterknife.BindView;

public class SmsSwitchActivity extends BaseActivity<SmsSwitchPresenter> {

    @BindView(R.id.toolBar)
    ToolBarLayout mToolBar;
    @BindView(R.id.title)
    TextView mTitle;
    @BindView(R.id.sms_mobile)
    TextView mSmsMobile;
    @BindView(R.id.sms_switch)
    CheckBox mSmsSwitch;

    public static void start(Context context) {
        Intent starter = new Intent(context, SmsSwitchActivity.class);
        context.startActivity(starter);
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_sms_switch;
    }

    @Override
    public SmsSwitchPresenter getPresenter() {
        return new SmsSwitchPresenter();
    }

    @Override
    protected void onViewBinding() {
        super.onViewBinding();
        mTitle.setText(App.INSTANCE.getString(R.string.strSmsSwitchActivity0));
        mToolBar.setLeftButtonOnClickLinster(v -> finish());
        String mobile = MyAppLication.getMobile();
        String start = mobile.substring(0, 3);
        String end = mobile.substring(7, 11);
        mSmsMobile.setText(start + "****" + end);

    }
}
